package com.szr.leex.dao;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import lombok.extern.slf4j.Slf4j;

/**
 * 项目启动类，
 * Created by WangChen on 2018/8/23 16:32.
 */
@ComponentScan(basePackages = "com.szr.leex")
// 由于本类位于com.szr.leex.dao包下，而dao需要引用到com.szr.leex.po下的实体类包，
// 所以这里需配置scanBasePackages= "com.szr.leex"
@SpringBootApplication(scanBasePackages = "com.szr.leex")
//@EnableJpaRepositories(repositoryFactoryBeanClass = GenericJpaRepositoryFactoryBean.class)
@EnableJpaRepositories(basePackages = "com.szr.leex")
@EntityScan(basePackages = "com.szr.leex")
@Slf4j
public class DaoApplication {

    public static void main(String [] args){
    	ConfigurableApplicationContext context = SpringApplication.run(DaoApplication.class, args);
//    	DebtorInfoDao debtorInfoDao = context.getBean(DebtorInfoDao.class);
//    	Pageable pageable = new PageRequest(0,10);
//        Page page = debtorInfoDao.findDtoPage("dashu",pageable);
//        log.info(JSON.toJSONString(page, true));
    }
}
